/*
 * Copyright (c) 2002-2004, xRhino, Inc.
 *
 * This library is free software; you can redistribute and/or modify
 * it under the terms of the dual license distributed with this source
 * package (a combined Trolltech QPL/GPL-compatible license)
 *
 * Under this dual license scheme, a separate license is available for use of 
 * this code with a proprietary (closed) system. For more information on the 
 * license, please see the LICENSE file distributed with this source package.
 */
#ifndef SUGNODE_H
#define SUGNODE_H

using namespace std;

#include <vector>

#include "SugNode.h"
#include "SugTypes.h"

/**
 * Currently just serves its purpose as SugElement's parent, this is a direct 
 * translation of the XML IDL.  Most of its node type functionality has 
 * currently been replaced by a more efficient C++ vector type approach.
 */
class SugNode
{
  protected:
   /**
    * The Node's name (currently unused)
    */
    char* mNodeName;

   /**
    * The Node's value (currently unused)
    */
   char* mNodeValue;

   /**
    * The Node's type (currently unused)
    */
   unsigned short mNodeType;

   /**
    * The Node's parent Node (currently unused)
    */
   SugNode* mParentNode;

   /**
    * The Node's children (currently unused)
    */
   vector<SugNode> mChildNodes;

   /**
    * The Node's first child (currently unused)
    */
   SugNode* mFirstChild;

   /**
    * The Node's last child (currently unused)
    */
   SugNode* mLastChild;

   /**
    * The Node's previous sibling (currently unused)
    */
   SugNode* mPreviousSibling;

   /**
    * The Node's next sibling (currently unused)
    */
   SugNode* mNextSibling;

  public:
   /**
    * Returns the node name. (unused)
    */
    char* getNodeName();

   /**
    * Sets the node name. (unused)
    */
    char* setNodeName(char* newNodeName); 

   /**
    * Returns the node value. (unused)
    */
    char* getNodeValue();

   /**
    * Sets the node value. (unused)
    */
    char* setNodeValue(char* newNodeValue);

   /**
    * Returns the node type. (unused)
    */
    unsigned short getNodeType();

   /**
    * Sets the node type. (unused)
    */
    unsigned short setNodeType(unsigned short newNodeType);

   /**
    * Returns the parent node. (unused)
    */
    SugNode* getParentNode();

   /**
    * Sets the parent node. (unused)
    */
    SugNode* setParentNode(SugNode* newParentNode);

   /**
    * Return the vector of child nodes. (unused)
    */
    vector<SugNode>* getChildNodes();

   /**
    * Returns the first child. (unused)
    */
    SugNode* getFirstChild();

   /**
    * Sets the first child. (unused)
    */
    SugNode* setFirstChild(SugNode* newFirstChild);

   /**
    * Returns the last child. (unused)
    */
    SugNode* getLastChild();

   /**
    * Sets the last child. (unused)
    */
    SugNode* setLastChild(SugNode* newLastChild);

   /**
    * Returns the previous sibling. (unused)
    */
    SugNode* getPreviousSibling();

   /**
    * Sets the previus sibling. (unused)
    */
    SugNode* setPreviousSibling(SugNode* newPreviousSibling);

   /**
    * Returns the next sibling. (unused)
    */
    SugNode* getNextSibling();

   /**
    * Sets the next sibling. (unused)
    */
    SugNode* setNextSibling(SugNode* newNextSibling);

   /**
    * Inserts a child before another (unused)
    */
    SugNode* insertBefore(SugNode* newChild, SugNode* refChild);

   /**
    * Replaces a child (unused)
    */
   SugNode* replaceChild(SugNode* newChild, SugNode* oldChild);

   /**
    * Removes a child (unused)
    */
   SugNode* removeChild(SugNode* oldChild);

   /**
    * Appends a child (unused)
    */
   SugNode* appendChild(SugNode* newChild);

   /**
    * Returns if the node has children (unused)
    */
   bool hasChildNodes();

   /**
    * Returns if the node has attributes
    */
   bool hasAttributes();

   /**
    * The class constructor
    */
   SugNode();

   /**
    * The class destructor
    */
   ~SugNode();

};

#endif
